package com.magoldeditor.model;

import org.jbox2d.collision.MassData;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.BodyDef;

public class Body implements IBody{
	private BodyDef bodyDef = new BodyDef();
	
	/**
	 * You can use this to initialized the mass properties of the body.
	 * If you prefer, you can set the mass properties after the shapes
	 * have been added using Body::setMassFromShapes.
	 */
	private MassData massData = bodyDef.massData;
	
	/** Use this to store application specific body data */
	private Object userData = bodyDef.userData;

    /**
     * The world position of the body.  Avoid creating bodies at the origin
     * since this can lead to many overlapping shapes.
     */
	private Vec2 position = bodyDef.position;
    
    /** The world angle of the body in radians. */
	private float angle = bodyDef.angle;

	/**
	 * Linear damping is use to reduce the linear velocity. The damping parameter
	 * can be larger than 1.0f but the damping effect becomes sensitive to the
	 * time step when the damping parameter is large.
	 */
	private float linearDamping = bodyDef.linearDamping;

	/**
	 * Angular damping is use to reduce the angular velocity. The damping parameter
	 * can be larger than 1.0f but the damping effect becomes sensitive to the
	 * time step when the damping parameter is large.
	 */
	private float angularDamping = bodyDef.angularDamping;
	
	/**
	 * Set this flag to false if this body should never fall asleep.  Note that
	 * this increases CPU usage.
	 */
	private boolean allowSleep = bodyDef.allowSleep;

    /** Is this body initially sleeping? */
	private boolean isSleeping = bodyDef.isSleeping;
    
    /** Should this body be prevented from rotating?  Useful for characters. */
	private boolean fixedRotation = bodyDef.fixedRotation;

	/**
	 * Is this a fast moving body that should be prevented from tunneling through
	 * other moving bodies? Note that all bodies are prevented from tunneling through
	 * static bodies.
	 * <BR><BR><em>Warning</em>: You should use this flag sparingly since it increases processing time.
	 */
	private boolean isBullet = bodyDef.isBullet;

	public MassData getMassData() {
		return massData;
	}

	public void setMassData(MassData massData) {
		this.massData = massData;
	}

	public Object getUserData() {
		return userData;
	}

	public void setUserData(Object userData) {
		this.userData = userData;
	}

	public Vec2 getPosition() {
		return position;
	}

	public void setPosition(Vec2 position) {
		this.position = position;
	}

	public float getAngle() {
		return angle;
	}

	public void setAngle(float angle) {
		this.angle = angle;
	}

	public float getLinearDamping() {
		return linearDamping;
	}

	public void setLinearDamping(float linearDamping) {
		this.linearDamping = linearDamping;
	}

	public float getAngularDamping() {
		return angularDamping;
	}

	public void setAngularDamping(float angularDamping) {
		this.angularDamping = angularDamping;
	}

	public boolean isAllowSleep() {
		return allowSleep;
	}

	public void setAllowSleep(boolean allowSleep) {
		this.allowSleep = allowSleep;
	}

	public boolean isSleeping() {
		return isSleeping;
	}

	public void setSleeping(boolean isSleeping) {
		this.isSleeping = isSleeping;
	}

	public boolean isFixedRotation() {
		return fixedRotation;
	}

	public void setFixedRotation(boolean fixedRotation) {
		this.fixedRotation = fixedRotation;
	}

	public boolean isBullet() {
		return isBullet;
	}

	public void setBullet(boolean isBullet) {
		this.isBullet = isBullet;
	}
}
